package com.glink.manage.mapper;

import com.glink.manage.domain.PersonAccessRelaBean;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.Set;

/**
 * @author  qiushaoshan
 * @since  2025-01-16
 */
public interface PersonAccessRelaMapper extends BaseMapper<PersonAccessRelaBean> {

    /**
     * 删除准入
     *
     * @param constructionWorkObjId  工程
     * @param participatingUnitObjId 参建单位
     * @param nowDate                当前时间
     */
    Integer delAccessByWorkObjIdAndUnitObjIdAndCycleStartGt(@Param("constructionWorkObjId") String constructionWorkObjId, @Param("participatingUnitObjId") String participatingUnitObjId, @Param("nowDate") String nowDate);

    /**
     * 更新准入
     *
     * @param constructionWorkObjId  工程
     * @param participatingUnitObjId 参建单位
     * @param nowDate                当前时间
     */
    void updateAccessCycleEndByWorkObjIdAndUnitObjIdAndCycleStartGtAndCycleEndLt(@Param("constructionWorkObjId") String constructionWorkObjId, @Param("participatingUnitObjId") String participatingUnitObjId, @Param("nowDate") String nowDate);

    /**
     * 根据工程ID查询未同步的人员ID
     *
     * @param constructionWorkObjId 工程ID
     * @return 人员ID
     */
    Set<Integer> findPersonIdByWorkIdAndNotSync(@Param("constructionWorkObjId") String constructionWorkObjId);
}
